#include<iostream>
#include<unistd.h>
#include<stdlib.h>
using namespace std;

int main()
{
  pid_t id = fork();
  if(id == 0)
  {
    while(1)
    {
      cout << "i am child : my pid " << getpid() << " my ppid" << getppid() << endl; 
      sleep(5);
      break;
    }
    exit(0);
  }
  else
  {
    while(1)
    {
      cout << "i am fatherd : my pid " << getpid() << " my ppid" << getppid() << endl; 
      sleep(1);
    }
  }
  return 0;
}
